package com.shire.web.console.service.account;

import com.shire.web.console.dao.account.WxAccountDao;
import com.shire.web.console.model.account.WxAccountExample;
import com.shire.web.console.model.account.WxAccount;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WxAccountService {
    @Resource
    private WxAccountDao wxAccountDao;

    public List<WxAccount> selectByExample(WxAccountExample example){
        return wxAccountDao.selectByExampleWithBLOBs(example);
    }

    public int save(WxAccount account){
        if (account.getId() == null){
            return wxAccountDao.insertSelective(account);
        }
        return wxAccountDao.updateByPrimaryKeySelective(account);
    }

    public WxAccount selectById(Integer id){
        return wxAccountDao.selectByPrimaryKey(id);
    }
}
